package com.oig.auth.api.factory;

import com.oig.auth.api.TenantInfoService;
import com.oig.auth.api.fallback.TenantInfoServiceFallbackImpl;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class TenantInfoFallbackFactory implements FallbackFactory<TenantInfoService> {

    @Override
    public TenantInfoService create(Throwable throwable) {
        TenantInfoServiceFallbackImpl tenantInfoServiceFallback = new TenantInfoServiceFallbackImpl();
        tenantInfoServiceFallback.setCause(throwable);
        return tenantInfoServiceFallback;
    }

}
